Database Connection Pool Druid usage instructions, database connection druid
Replace it with the optimal database connection pool based on factors such as comprehensive performance, reliability, stability, scalability, and ease of use.
D
Introduction to Druid
Druid First is a database connection pool. Druid is currently the best database connection pool, in terms of function, performance, extensibility, are more than other database connection pool, including DBCP,
to speed up the query speed of Column-store, using an algorithm called concise to compress bitmap indexing, Makes the generated segments much smaller than the original text file;
In our application scenario (altogether 10 machines, the data is about 100 columns, the number of rows is billion), the average query time
Some of the "limitations" of Druid:
The non-modifiable nature of segment simplifies the implementation of
When configuring Hibernate, I met the use of Druid to decrypt the database, leaving a text for the next reference.
1. Encryption and decryption is performed in the SSH framework, respectively:
Pom.xml (Data encryption)
Config.properties (Configure decryption secret key)
So how did these two secret keys come into being?
First we have to download a Druid-1.0.16.j
Tags: sharding first come ROM features tor mid-large number usage performance improvementMainstream database connection poolCommon open source database connection pools are c3p0, DBCP, Tomcat Jdbc pool, BONECP, druid, etc.C3P0: Open source JDBC Connection pool, which implements the data source and Jndi bindings, supports the standard extension of the JDBC3 specif
concept:
The database connection pool is responsible for allocating, managing, and freeing the database connection, which allows the application to reuse an existing database connection instead of re-establishing a database connection that is idle for more than the maximum idle time to avoid missing the
olling Software Updates Withno downtime.druid is similiar to c-store [+] and lazybase [8] in that it hasnbsp ; Twosubsystems,aread-optimizedsubsysteminthehistoricalnodesandawrite-optimizedsubsysteminreal-timenodes. Real-timenodesare designed to ingest a high volume of append heavy data, and Donot support data updates. Unlike the aforementioned systems,druid is meant for OLAP transactions and not OLTP Transactions.druid ' s L OW latency data ingestion
Recent projects need to be in the configuration of the database password encryption, the use of Ali's Druid to achieve, the process and issues to share with you.The project is using Spring Plus jetty, the original database connection using Apache Dbcp:commons-dbcp2-2.1.1.jar+ojdbc6.jar Configuration: jdbc:derby:memory:spring-test;create=true Ch
Background description: According to project requirements, use Druid connection pool to connect MySQL database and Derby database; Problem Description: In Derby database environment error: Init dataSource error Encounter "Url:jdbc:derby://localhost:1527/dbname
DriverClassName:org.apache.derby.jdbc.ClientDriver
Username
The Druid is the best database connection pool in the Java language and provides powerful monitoring and scaling capabilities. the industry compared Druid and HIKARICP, although HIKARICP performance is higher than Druid, but because Druid includes many dimensions of statis
Druid is the best database connection pool in the Java language and can provide powerful monitoring and extension capabilities.
The default data source for Spring boot is: Org.apache.tomcat.jdbc.pool.DataSource
How to configure the use of Druid in spring Boot, the overall step:
(1)--druid Simple Introduction, concr
pom.xml configuration Dependencies Https://mvnrepository.com/artifact/com.alibaba/druid -Dependency> groupId>Com.alibabagroupId> Artifactid>DruidArtifactid> version>1.1.6version>Dependency> resource file configuration informationwhether it is a yml file or a properties file, use the following configuration# Database Access configuration spring.datasource.type:com.alibaba.druid.pool.druiddatasour
Tags: use init data source BSP HTM href directory map user1. Download Druid 2. Put the druid you just downloaded into the Lib directory under Tomcat 3. Configure the service startup file to be monitored, add:-djava.net.preferipv4stack=true-dcom.sun.management.jmxremote- dcom.sun.management.jmxremote.port=4090-dcom.sun.management.jmxremote.rmi.port=4090- Dcom.sun.management.jmxremote.ssl=false-dcom.sun.manag
SpringBoot integrates Mybatis with Druid database connection pool, springbootmybatis
The following example shows how spring boot integrates Mybatis with Druid database connection pool.
Add the following dependencies to the SpringBoot project:
In the resource Directory, create the jdbc. properties configuration file an
This paper mainly describes the criteria of database connection pool parameter configuration, and gives the recommended configuration for common database connection pool (C3P0,DBCP,DRUID).Factors to consider1: Size of current connection DB 2: Concurrency Scenario 3: Response time for DB executionConfiguration considerations1: Initialize connection: Consider setti
The database connection URL that was previously configured in the Pom file, many configurations are written in the Pom file causing the configuration file to be too longThe new project writes the configuration to a different folder in the properties file.Db.url directly copied in the Pom file.Jdbc:mysql://127.0.0.1:3306/portal?useunicode=trueamp;characterencoding=utf-8amp; Autoreconnect=true Then the testcase test insert has been garbled.View
Is the MAVEN configuration file: Pom.xml's code content:
Application-beans.xml's code content:
Dao class:
Package DAO;
Import Org.springframework.jdbc.core.support.JdbcDaoSupport;
public class Dao extends Jdbcdaosupport {
}
Spring JDBC reference URL: Https://www.yiibai.com/springjdbc/preparedstatementsetter.html#article-start
Druid:maven Pom.xml Join
C3p0:maven Pom.xml Join
Druid.xml content is as follows:
C3p0.xml content is as follows:
From the top of the configuratio
1, use DataSource, fill in the corresponding URL username and password can be! 2. Add in Web. xml3, because I use EXTJS development background, the monitoring page embedded in the ExtJS code as follows:Ext.define (' Kl.view.DruidMonitor ', { extend: ' Ext.panel.Panel ', alias: ' Widget.druidmonitor ', height: , HTML: ' Last sticker:Add database monitoring to your app (with Druid)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.